package com.atguigu.gmall.web;

import com.atguigu.gmall.common.interceptor.FeignInterceptor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

/**
 * @Auther 赵乾坤
 * @Date 2020-12-23 20:28
 */
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)//取消数据源自动配置
@ComponentScan({"com.atguigu.gmall"})
@EnableDiscoveryClient//开启注册中心的客户端		在客户端启动类用
@EnableFeignClients(basePackages= {"com.atguigu.gmall"})//开启远程调用，远程调用的扫描包
public class WebAllApplication {

    public static void main(String[] args) {
        SpringApplication.run(WebAllApplication.class, args);
    }

    //远程调用的拦截器引入到Web-all
    @Bean
    public FeignInterceptor feignInterceptor(){
        return new FeignInterceptor();
    }

}
